clear
set more off

cd "D:\data_replication"

import delimited estimation\5_supply_side\k_to_i_k.csv
save estimation\4_demand_estimation\4_cobb_douglas_weights\k_to_i_k.dta, replace


use estimation\4_demand_estimation\4_cobb_douglas_weights\weights_k.dta, clear
merge m:1 k using estimation\4_demand_estimation\4_cobb_douglas_weights\k_to_i_k.dta
keep i_k year quarter declarant s_20_k s_80_k
order i_k year quarter declarant s_20_k s_80_k
sort i_k year quarter declarant s_20_k s_80_k
rename s_20_k s_20_i_k
rename s_80_k s_80_i_k
save estimation\4_demand_estimation\4_cobb_douglas_weights\weights_i_k.dta, replace
export delimited estimation\4_demand_estimation\4_cobb_douglas_weights\weights_i_k.csv, replace

rm estimation\4_demand_estimation\4_cobb_douglas_weights\k_to_i_k.dta

